/**
 * 
 */
package com.volatileshooter.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Ahmed
 *
 */
public class Bucket {
	
	private List<Entity> entities;
	
	private String name;
	
	private BucketManager controller;

	public Bucket(String name, BucketManager controller) {
		this.name = name;
		this.controller = controller;
		entities = new ArrayList<Entity>();
	}
	
	public List<Entity> getEntities() {
		return entities;
	}
	
	public String getName() {
		return name;
	}
	
	public BucketManager getController() {
		return controller;
	}
	
	public void update(float dt) {
		if (controller != null) {
			controller.update(dt, this);
		}
		for (int i = entities.size(); --i>=0; ) {
			entities.get(i).update(dt);
		}
	}

}
